cmake_minimum_required (VERSION 2.8)

set( TARGET_NAME test_bmock_dynamic_mocks )

set(SOURCES
	bmock_control_tools_mock.cpp	
	function_mocks_newmocks.cpp	
	test_bmock_create_method_mocks_newmocks.cpp	
	test_bmock_create_mock_newmocks.cpp	
	test_exact_function_mocks_test_mode_newmocks.cpp	
	test_exact_method_mocks_test_mode_newmocks.cpp
	test_exact_mocks_creation.cpp	
	test_generate_mock_class_newmocks.cpp
)

set(HEADERS
	bmock_control_tools_mock.hpp	
	function_mocks_newmocks.hpp	
	test_generate_mock_class_newmocks.hpp
	stdafx.h
)


ADD_MSVC_PRECOMPILED_HEADER( stdafx.h stdafx.cpp SOURCES )

add_executable( ${TARGET_NAME} ${SOURCES} ${HEADERS} )

add_dependencies( ${TARGET_NAME} bmock test_bmock_raw_mem test_bmock_argument test_bmock_expectation test_bmock )

target_link_libraries( ${TARGET_NAME} bmock )
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
	target_link_libraries( ${TARGET_NAME} pthread boost_system boost_signals boost_test_exec_monitor boost_regex boost_thread )
endif()

get_target_property(OUTPUT_FULL ${TARGET_NAME} LOCATION)
add_custom_command( TARGET ${TARGET_NAME} POST_BUILD 
	COMMAND ${OUTPUT_FULL} --build_info=no --result_code=no --show_progrss=no --catch_system_errors=yes --detect_memory_leak=1 --report_level=no  --log_level=warning
)

